package com.evil.application.api;

import com.evil.application.config.FeignErrorDecoder;
import com.evil.application.pojo.dto.order.log.AddRobotLogReqDTO;
import com.evil.application.pojo.dto.order.log.OrderLogRespDTO;
import com.evil.common.core.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 应用订单日志接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.APPLICATION_SERVICE, configuration = {FeignErrorDecoder.class})
public interface RemoteApplicationOrderLogService {

    /**
     * 订单日志
     *
     * @param orderId orderId
     * @return List
     */
    @PostMapping("/remote/application/order/log/list")
    List<OrderLogRespDTO> orderLog(@RequestParam("orderId") Long orderId);

    /**
     * 新增订单节点日志
     *
     * @param addRobotLogReqDTO addRobotLogReqDTO
     */
    @PostMapping("/remote/application/order/add-robot-log")
    void addOrderLog(@Validated @RequestBody AddRobotLogReqDTO addRobotLogReqDTO);
}
